const axios = require('axios')

const service = axios.create({
  baseURL: 'https://open.feishu.cn/open-apis',
  timeout: 50000,
})
// 响应拦截
service.interceptors.response.use(
  response => {
    // console.log(response);
    if (response.status !== 200) {
      alert("网络链接错误，请稍后再试")
    }
    return response
  },
  error => {
    return error.message
  }
)
// 请求拦截
service.interceptors.request.use(
  (config) => {
    return config
  },
  error => {
    return error.message
  }
)
module.exports = service